{{extend './extend.art'}}
{{block 'title'}}Blog - Content Manager{{/block}}
{{block 'body'}}
<body>
    {{include './header.art'}}
    <!-- 主体内容 -->
    <div class = "content">
        {{include './aside.art'}}
        <div class = "main">
            <!-- 分类标题 -->
            <div class = "title">
                <h4>{{id?id:'新增用户'}}</h4>
                <p class = "tips">错误信息 : {{message? message :''}}</p>
            </div>
            <!-- /分类标题 -->
            {{if id==undefined}}
            <form class = "form-container" method = "post" action = "/admin/user-add">
             {{else }}
             <form class = "form-container" method = "post" action = "/admin/user-edit?id={{id}}">
             {{/if}}
                <div class = "form-group">
                    <label>用户名</label>
                    <input type = "text" class = "form-control" value = "{{result&&result.name}}" name = "name">
                </div>
                <div class = "form-group">
                    <label>邮箱</label>
                    <input type = "email" class = "form-control" value = "{{result&&result.email}}" name = "email">
                </div>
                <div class = "form-group">
                    <label>密码</label>
                    <input type = "password" class = "form-control" placeholder = "请输入密码" name = "password" value="{{result&&result.password}}">
                </div>
                <div class = "form-group">
                    <label>角色</label>
                    <select class = "form-control" name = "role">
                        <option {{  result&&result.role =="普通用户"?"selected":"" }}>普通用户</option>
                        <option {{ result&&result.role =="超级管理员"?"selected":"" }}>超级管理员</option>
                    </select>
                </div>
                <div class = "form-group">
                    <label>状态</label>
                    <select class = "form-control" name = "state">
                        <option {{ result&&result.state =="启用"?"selected":"" }}>启用</option>
                        <option {{ result&&result.state =="禁用"?"selected":"" }}>禁用</option>
                    </select>
                </div>

                <div class = "buttons">
                    {{if id==undefined}}
                    <input type = "submit" class = "btn btn-primary" value="新增用户">
                    {{else}}
                    <input type = "submit" class = "btn btn-primary" value="确定修改">
                    {{/if}}
                </div>



            </form>
        </div>
    </div>
    <!-- /主体内容 -->
    {{include './layout.art'}}
</body>
{{/block}}